package com.sq.partner.manager.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.sq.partner.manager.dao.ActirationCardApplyDao;
import com.sq.partner.manager.mybatis.model.ActirationApplyCardExcel;
import com.sq.partner.manager.mybatis.model.ActirationCardApply;
import com.sq.partner.manager.mybatis.model.ActirationCardDifinition;
import com.sq.partner.manager.util.Page;
/**
 * 卡单申请Dao实现
 * SQ
 *
 */
@Repository
public class ActirationCardApplyDaoImpl extends BaseDaoImpl implements ActirationCardApplyDao{
	@Override
	public boolean insert(ActirationCardApply applyinfo) throws Exception{
		return this.add("insertActirationCardApply", applyinfo);
	}
	@Override
	public boolean delete(String applyinfo) throws Exception{
		return this.delete("deleteActirationCardApply", applyinfo);
	}
	@Override
	public boolean update(ActirationCardApply applyinfo) throws Exception{
		return this.update("updateActirationCardApply", applyinfo);
	}
	@Override
	public ActirationCardApply query(String applyinfo) throws Exception{
		return (ActirationCardApply)this.query("queryActirationCardApply",applyinfo);
	}
	@SuppressWarnings("unchecked")
	@Override
	public Page<ActirationCardApply> queryPage(Page<ActirationCardApply> page) throws Exception{
		Map<String,Object> paramMap = page.getMap();
		page.setTotal((Integer)this.query("queryActirationCardApplyCount", paramMap));
		page.setData((List<ActirationCardApply>)this.queryList("queryActirationCardApplyList",paramMap));
		return page;
	}
	@SuppressWarnings("unchecked")
	@Override
	public List<ActirationApplyCardExcel> queryForCardExcel(
			Map<String, Object> map) throws Exception {
		
		return this.queryList("queryCardInfoForExcel", map);
	}
	@Override
	public ActirationCardApply getCardInfo(Map<String, Object> map)
			throws Exception {
		// TODO Auto-generated method stub
		return (ActirationCardApply) this.query("selectCardInfo", map);
	}
	@SuppressWarnings("unchecked")
	@Override
	public Page<ActirationCardDifinition> queryDefineByRegion(Page<ActirationCardDifinition> page) throws Exception{
		page.setTotal((Integer)this.query("queryDefineByRegionCount", page.getMap()));
		page.setData((List<ActirationCardDifinition>)this.queryList("queryDefineByRegion", page.getMap()));
		return page;
	}
	
}
